package com.houdoudou.bean;

import com.houdoudou.customer.common.Constant;

import net.sf.json.JSONObject;

public class Order {

  public static String ID="id"; //	long id=-1;
  public static String STATE ="state";	// int state=-1;
  public static String PRODUCTNUM="productNum";//	int productNum=-1; //产品数量
  public static String SECRET="secret";//	String secret="";
  public static String VOLUME="volume";//	int volume=-1; //总体积
  public static String BOXVOLUME="boxVolume";  //int boxVolume=-1; //箱格体积
  public static String	BOXNUM="boxNum";  //int boxNum=-1; //箱格数量
  public static String	ISBOXUSED="isBoxUsed";  //int boxUsage=-1; //是否使用
  public static String	BOXESIN="boxesIn";  //String boxesIn="";   //放入箱格编号
  
  public static String  MACHINEID="machineID"; //int machineID=-1; //自提柜
  public static String  MACHINEADDRESS="machineAddress";//String machineAddress=""; 
  public static String	MACHINENAME="machineName"; //String machineName="";
	
  public static String	DATEAA="dateAA";   //  String dateAA="";
  public static String  TIMEFLAG="timeFlag";  //int timeFlag=-1;
	
	
  public static String	CUSTOMERTELNUM="customerTelnum";   //String customerTelnum=""; //消费者电话
  public static String	OWNERTELNUM="ownerTelnum";  //String ownerTelnum="";
  public static String  SUPPLIERTELNUM="supplierTelnum"; //	String supplierTelnum="";
  public static String  SUPPLIERNAME="supplierName";  //String supplierName="";
  public static String	SERVICETELNUM="serviceTelnum";     //String serviceTelnum="";
	
  public static String	DATETIMEPL="dateTimePL";  //String dateTimePL=""; //下单时间
  public static String  DATETIMEPA="dateTimePA";  //String dateTimePA=""; //支付时间
  public static String	DATETIMEAE="dateTimeAE";  //String dateTimeAE=""; //最早送达时间
  public static String	DATETIMEAA="dateTimeAA";  //String dateTimeAA=""; //约定送达时间
  public static String  DATETIMEAI="dateTimeAI";  //String dateTimeAI=""; //实际送达时间
  public static String  COURIERAITELNUM="courierAITelnum";  //String courierAITelnum=""; //送货员电话
  public static String	DATETIMETK="dateTimeTK";  //String dateTimeTK=""; //取走时间
  public static String	DATETIMETL="dateTimeTL";  //String dateTimeTL=""; //消费者最迟取走
  public static String  DATETIMERK="dateTimeRK";  //String dateTimeRK=""; //取回时间
  public static String	COURIERRKTELNUM="courierRKTelnum"; //String courierRKTelnum=""; //取回的送货员电话
  public static String  DATETIMERL="dateTimeRL";  //String dateTimeRL=""; //最晚取回时间
  public static String  DATETIMEAB="dateTimeAB";  ////	String dateTimeAB=""; //抛弃订单时间
  public static String  COURIERABTELNUM="courierABTelnum"; ////String courierABTelnum=""; //抛弃快递员的电话
  public static String  DATETIMERF="dateTimeRF";  ////String dateTimeRF=""; //拒绝订单时间
	
  public static String DATETIMERDL="dateTimeRDL";  ////String dateTimeRDL=""; //最迟申请退款时间
  public static String ISREFUND="isRefund";  //   int  isRefund=-1; //退款情况，1，无退款，2，有退款
	
  public static String BOXFEECU="boxFeeCu"; //  double boxFeeCu=-1; //商家收取的箱格费
  public static String MONEYPRODUCT="moneyProduct"; //double moneyProduct=-1; //商品金额
  public static String MONEYFREIGHT="moneyFreight"; //double moneyFreight=-1; //运费。
  public static String MONEYCU="moneyCu";  //double moneyCu=-1; //消费者支付的钱
  public static String BOXFEESU="boxFeeSu"; //double boxFeeSu=-1; //业主收取的箱格费
  public static String RATESU="rateSu" ;//double rateSu=-1; //业主提成。
  public static String RATEOW="rateOw"; //	double rateOw=-1; //公司提成
  public static String MONEYCOMPANY="moneyCompany"; //	double moneyCompany=-1; 
  public static String MONEYOWNER="moneyOwner";  //double moneyOwner=-1;
  public static String MONEYSUPPLIER="moneySupplier"; //double moneySupplier=-1;
  public static String ISMONEYDEALED="isMoneyDealed"; //int    isMoneyDealed=-1; //该订单是否结算。1，未， 2已
  public static String ISMONEYPAID="isMoneyPaid";  //int    isMoneyPaid=-1; //该订单是否支付  1未， 2已经
  public static String NOTE="note"; 
  
  public static JSONObject createBasicOrderJO(JSONObject supplierJO){
	  JSONObject orderJO= new JSONObject();
	  //添加 消费者
	  orderJO.put(CUSTOMERTELNUM, Constant.customerJO.getString(Customer.TELNUM));	 
	  // 初始化一些不需要添加 加入的字段 
	  // 这些应该放在服务器里。
	  
	  orderJO.put(STATE, 1);
	  orderJO.put(ISREFUND, 1);
	  orderJO.put(ISMONEYPAID, 1);
	  orderJO.put(ISMONEYDEALED, 1);
	  orderJO.put(ISBOXUSED, 1);
	  // 放入商家相关字段
	  orderJO.put(OWNERTELNUM, supplierJO.getString(Supplier.OWNER));
	  orderJO.put(SUPPLIERTELNUM, supplierJO.getString(Supplier.TELNUM));
	  orderJO.put(SUPPLIERNAME, supplierJO.getString(Supplier.NAME));
	  orderJO.put(SERVICETELNUM, supplierJO.getString(Supplier.SERVICETELNUM));
	  
	  orderJO.put(BOXFEECU, supplierJO.getDouble(Supplier.BOXFEECU));
	  orderJO.put(BOXFEESU, supplierJO.getDouble(Supplier.BOXFEESU));
	  orderJO.put(RATESU, supplierJO.getDouble(Supplier.RATE));
	  
	  //放入自提柜相关消息。
	  orderJO.put(MACHINEID, Constant.machineJO.getInt(Machine.ID));
	  orderJO.put(MACHINENAME, Constant.machineJO.getString(Machine.NAME));
	  orderJO.put(MACHINEADDRESS, Constant.machineJO.getString(Machine.ADDRESS)+Constant.machineJO.getString(Machine.NAME));
	  orderJO.put(BOXVOLUME, Constant.machineJO.getInt(Machine.BOXVOLUME));
	  
	  // 放入时间点消息。目前只能放一个值
	  orderJO.put(TIMEFLAG, supplierJO.getInt(TIMEFLAG));
	  orderJO.put("timeAA", supplierJO.getString("timeAA"));
	  return orderJO;
  }
  
 
  
}
